using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using SamasDBI;
using SamasDBI.MySQL;
using EQEmuMysql;

namespace EQEmulatorGUI
{
    public partial class frmAccounts : Form
    {
        private SortedList<int, Accounts> lsAccounts;
        private Accounts objAccount;
        private bool flgAccountsLoaded = false;
        public frmAccounts()
        {
            InitializeComponent();
        }
        public void AccountsList()
        {
            flgAccountsLoaded = false;
            ListViewItem lsvItem;
            lsvAccounts.Items.Clear();

            if (flgAccountsLoaded == false)
            {
                lsAccounts = Lists.AccountList();
                flgAccountsLoaded = false;
            }
            foreach (Accounts oAccount in lsAccounts.Values)
            {
                lsvItem = new ListViewItem(oAccount.Name);
                lsvItem.Tag = oAccount.ID.ToString();

                lsvAccounts.Items.Add(lsvItem);
            }
        }

        private void frmAccounts_Load(object sender, EventArgs e)
        {
            AccountsList();
        }
    }
}